Socket
Socket
Sign inDemoInstall

@nodestrap/element

Package Overview
Dependencies
10
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nodestrap/element

A basic building block without any applied stylesheet of nodestrap components.


Version published
Maintainers
1
Install size
1.73 MB
Created

Readme

Source

<Element />

A basic building block without any applied stylesheet of nodestrap components.
This is the most generic element for the base of (more) complex components.

Preview

<Element>
    hello world
</Element>

Rendered to:

<div>
    hello world
</div>

<Element tag='span' classes={['button', 'awesome']} variantClasses={['big', 'dark']} stateClasses={['hovered']}>
    hello world
</Element>

Rendered to:

<span class="button awesome big dark hovered">
    hello world
</span>

<Element semanticTag={['ul', 'ol']} semanticRole='list'>
    hello world
</Element>
<Element semanticTag={['ul', 'ol']} semanticRole='list' tag='ul'>
    hello world
</Element>
<Element semanticTag={['ul', 'ol']} semanticRole='list' tag='ol'>
    hello world
</Element>
<Element semanticTag={['ul', 'ol']} semanticRole='list' tag='div'>
    hello world
</Element>

Rendered to:

<ul>
    hello world
</ul>
<ul>
    hello world
</ul>
<ol>
    hello world
</ol>
<div role="list">
    hello world
</div>

Features

  • Dynamic tag name tag='div'.
  • Smart semantic tag & role.
  • Access the DOM element via elmRef= (similar to ref=).

Installation

Using npm:

npm i @nodestrap/element

Support Us

If you feel our lib is useful for your projects,
please make a donation to avoid our project from extinction.

We always maintain our projects as long as we're still alive.

[Make a donation]

Keywords

FAQs

Last updated on 06 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc